local que_youjing = fk.CreateSkill {
    name = "que_youjing",
    tags = { Skill.Compulsory, },
}

Fk:loadTranslationTable {
    ["que_youjing"] = "游境",
    [":que_youjing"] = "锁定技，“昭华”牌不计入手牌上限，且进入弃牌堆时，你获得之，且本回合不能使用因此回收的牌；其他角色无法使用或打出“昭华”牌。",
}
que_youjing:addEffect(fk.AfterCardsMove, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(que_youjing.name) then
            local cards = {}
            for _, move in ipairs(data) do
                if move.toArea == Card.DiscardPile then
                    for _, info in ipairs(move.moveInfo) do
                        if Fk:getCardById(info.cardId):getMark("@@zhaohua") > 0 then
                            table.insertIfNeed(cards, info.cardId)
                        end
                    end
                end
            end
            cards = player.room.logic:moveCardsHoldingAreaCheck(cards)
            if #cards > 0 then
                event:setCostData(self, { cards = cards })
                return true
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local card = table.filter(event:getCostData(self).cards, function(c)
            return table.contains(room.discard_pile, c)
        end)
        if #card > 0 then
            if player.room.current ~= player then
                room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, que_youjing.name, nil, true, player)
            else
                room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, que_youjing.name, nil, true, player,
                    "youjing-turn")
            end
        end
    end,
})
que_youjing:addEffect("prohibit", {
    prohibit_use = function(self, player, card)
        if player:hasSkill(que_youjing.name) and card:getMark("youjing-turn") > 0 and card:getMark("@@zhaohua") > 0 then
            return true
        end
        if not player:hasSkill(que_youjing.name) and card:getMark("@@zhaohua") > 0 then
            return true
        end
        return false
    end,
    prohibit_response = function(self, player, card)
        if not player:hasSkill(que_youjing.name) and card:getMark("@@zhaohua") > 0 then
            return true
        end
        return false
    end
})
que_youjing:addEffect("maxcards", {
    exclude_from = function(self, player, card)
        return player:hasSkill(que_youjing.name) and card:getMark("@@zhaohua") > 0
    end,
})
return que_youjing
